<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
      
        <li class="active"><a href="">列表</a></li>

    </ul>
    <form class="well form-inline margin-top-20" method="post" action="">
       
        时间:
        <input type="text" class="form-control js-bootstrap-date" name="create_time"
               value="{$Request.param.create_time|default=''}"
               style="width: 140px;" autocomplete="off">
        &nbsp; &nbsp;
        创建人:
        <select class="form-control" name="t_user_id" style="width: 140px;">
            <option value='0'>全部</option>
            <foreach name="data_app_user" item="vo">
                <if condition="$vo.id == $Request.param.t_user_id">
                    <option value='{$vo.id}' selected>{$vo.realName}</option>
                <else/>
                    <option value='{$vo.id}' >{$vo.realName}</option>
                </if>
            </foreach>
        </select> &nbsp;&nbsp;
        套件ID:
        <input type="text" class="form-control" name="group_id" style="width: 200px;"
               value="{$Request.param.group_id|default=''}" placeholder="请输入关键字...">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="">清空</a>
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('TemplateGroup/sort')}">
        <div class="table-actions">
           <!--  <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
           <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                   data-action="{:url('TemplateGroup/sets',array('status'=>1))}" data-subcheck="true">启用
           </button> -->
            <button class="btn btn-primary btn-sm js-ajax-submit add" type="button" data-subcheck="true">选择班组
            </button>
        </div>
        
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">套件ID</th>
                <th>表头名称</th>
                <th>课题名称</th>
				<th>表尾名称</th>
                <th>主题活动名称</th>
                <th>模板类别</th>
                <th>创建人</th>
                <th>创建日期</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="vo">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.group_id}"></td>
                    
                    <td>{$vo.group_id}</td>
					<td>{$vo.header.name} &nbsp;ID:{$vo.header_id}</td>
                    <td>{$vo.template.name}&nbsp;ID:{$vo.template_id}</td>
                    <td>{$vo.footer.name}&nbsp;ID:{$vo.footer_id}</td>
                    <td>{$vo.category.name}</td>
                     <td>{$vo.category.parent.name}</td>
                    <td>{$vo.appuser.realName}</td>
                    <td>{$vo.create_time}</td>
                    <td>
						<a href="javascript:look({$vo.group_id})">预览</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
            <tfoot>
            <tr>

                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">套件ID</th>
                <th>表头名称</th>
                <th>课题名称</th>
                <th>表尾名称</th>
                <th>主题活动名称</th>
                <th>模板类别</th>
                <th>创建人</th>
                <th>创建日期</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </tfoot>
        </table>
        <!-- <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateGroup/sets',array('status'=>1))}" data-subcheck="true">启用
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateGroup/sets',array('status'=>2))}" data-subcheck="true">停用
            </button>
        </div> -->
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    function look(id){
        openIframeLayer("/teacher/Template_group/look/group_id/"+id, '预览', {
            area: ['40%', '90%'],
        });
    }
    $('.add').click(function(){
        var vals = [];
        $('input:checkbox:checked').each(function (index, item) {
            var value = $(this).val();
            if(value != 'on'){
                vals.push(value);
            }
        });

        vals = vals.join(',');
        if (vals == '') {
            alert('请选中套件');return false;
        }
        window.location.href = 'http://'+window.location.host+'/teacher/record/add?vals='+vals;
    });
</script>
</body>
</html>